... and _gtk_css_style_property_changes_affect_font().
Replace it with _gtk_css_style_property_get_mask_affecting().
G_DEFINE_TYPE (GtkCssStyleProperty, _gtk_css_style_property, GTK_TYPE_STYLE_PROPERTY)
-static GtkBitmask *_properties_affecting_size = NULL;
-static GtkBitmask *_properties_affecting_font = NULL;
-
static GtkCssStylePropertyClass *gtk_css_style_property_class = NULL;
static void
property->id = klass->style_properties->len;
g_ptr_array_add (klass->style_properties, property);
- if (property->affects & (GTK_CSS_AFFECTS_SIZE | GTK_CSS_AFFECTS_CLIP))
- _properties_affecting_size = _gtk_bitmask_set (_properties_affecting_size, property->id, TRUE);
-
- if (property->affects & GTK_CSS_AFFECTS_FONT)
- _properties_affecting_font = _gtk_bitmask_set (_properties_affecting_font, property->id, TRUE);
-
G_OBJECT_CLASS (_gtk_css_style_property_parent_class)->constructed (object);
}
klass->style_properties = g_ptr_array_new ();
- _properties_affecting_size = _gtk_bitmask_new ();
- _properties_affecting_font = _gtk_bitmask_new ();
-
gtk_css_style_property_class = klass;
}
return result;
}
-gboolean
-_gtk_css_style_property_changes_affect_size (const GtkBitmask *changes)
-{
- return _gtk_bitmask_intersects (changes, _properties_affecting_size);
-}
-
-gboolean
-_gtk_css_style_property_changes_affect_font (const GtkBitmask *changes)
-{
- return _gtk_bitmask_intersects (changes, _properties_affecting_font);
-}
GtkBitmask * _gtk_css_style_property_get_mask_affecting
(GtkCssAffects affects);
-gboolean _gtk_css_style_property_changes_affect_size
- (const GtkBitmask *changes);
-gboolean _gtk_css_style_property_changes_affect_font
- (const GtkBitmask *changes);
G_END_DECLS
static void
gtk_text_view_style_updated (GtkWidget *widget)
{
+ static GtkBitmask *affects_font = NULL;
GtkTextView *text_view;
GtkTextViewPrivate *priv;
PangoContext *ltr_context, *rtl_context;
GtkStyleContext *style_context;
const GtkBitmask *changes;
+ if (G_UNLIKELY (affects_font) == NULL)
+ affects_font = _gtk_css_style_property_get_mask_affecting (GTK_CSS_AFFECTS_FONT);
+
text_view = GTK_TEXT_VIEW (widget);
priv = text_view->priv;
style_context = gtk_widget_get_style_context (widget);
changes = _gtk_style_context_get_changes (style_context);
- if ((changes == NULL || _gtk_css_style_property_changes_affect_font (changes)) &&
+
+ if ((changes == NULL || _gtk_bitmask_intersects (changes, affects_font)) &&
priv->layout && priv->layout->default_style)
{
gtk_text_view_set_attributes_from_style (text_view,
static void
gtk_tree_view_style_updated (GtkWidget *widget)
{
+ static GtkBitmask *affects_size = NULL;
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
GList *list;
GtkTreeViewColumn *column;
GtkStyleContext *style_context;
const GtkBitmask *changes;
+ if (G_UNLIKELY (affects_size) == NULL)
+ affects_size = _gtk_css_style_property_get_mask_affecting (GTK_CSS_AFFECTS_SIZE | GTK_CSS_AFFECTS_CLIP);
+
GTK_WIDGET_CLASS (gtk_tree_view_parent_class)->style_updated (widget);
if (gtk_widget_get_realized (widget))
style_context = gtk_widget_get_style_context (widget);
changes = _gtk_style_context_get_changes (style_context);
- if (changes == NULL || _gtk_css_style_property_changes_affect_size (changes))
+
+ if (changes == NULL || _gtk_bitmask_intersects (changes, affects_size))
{
for (list = tree_view->priv->columns; list; list = list->next)
{
if (widget->priv->anchored)
{
- if (changes == NULL || _gtk_css_style_property_changes_affect_size (changes))
+ static GtkBitmask *affects_size = NULL;
+
+ if (G_UNLIKELY (affects_size) == NULL)
+ affects_size = _gtk_css_style_property_get_mask_affecting (GTK_CSS_AFFECTS_SIZE | GTK_CSS_AFFECTS_CLIP);
+
+ if (changes == NULL || _gtk_bitmask_intersects (changes, affects_size))
gtk_widget_queue_resize (widget);
else
gtk_widget_queue_draw (widget);